package com.siruier.boss.ui.listener

import com.umeng.socialize.UMAuthListener
import com.umeng.socialize.bean.SHARE_MEDIA

class UMAuthListener(
    var onStart: ((SHARE_MEDIA) -> Unit)? = null,
    var onError: ((SHARE_MEDIA, Throwable) -> Unit)? = null,
    var onCancel: ((SHARE_MEDIA) -> Unit)? = null,
    var onComplete: ((SHARE_MEDIA, MutableMap<String, String>) -> Unit)? = null
) : UMAuthListener {
    override fun onComplete(p0: SHARE_MEDIA, p1: Int, p2: MutableMap<String, String>) {
        onComplete?.invoke(p0 , p2)
    }

    override fun onCancel(p0: SHARE_MEDIA, p1: Int) {
        onCancel?.invoke(p0)
    }

    override fun onError(p0: SHARE_MEDIA, p1: Int, p2: Throwable) {
        onError?.invoke(p0,p2)
    }

    override fun onStart(p0: SHARE_MEDIA) {
        onStart?.invoke(p0)
    }

}